<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8">
<title>编辑</title>
<@fm.header />
</head>
<body>
<div class="easyui-layout" style="text-align: center; height: 270px;" fit="true">
	<div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
	<form id="ff" method="post" action="/miguVideoConfig/update" enctype="multipart/form-data">
	    <table style=" border-spacing:10px; ">
		       <tr>
                   <td align="left">名称</td>
                   <td colspan="3">
                       <input type="text" name="name"  id="nameId" value="${mvc.name}" style="width:300px;" class="easyui-validatebox" data-options="required:true">
                   </td>
               </tr>
               <tr>
                   <td align="left">日限</td>
                   <td colspan="3">
                       <input type="text" name="totalNum" id="totalNumId" value="${mvc.totalNum}" class="easyui-validatebox" data-options="required:true" style="width:300px;">
                   </td>
               </tr>
               <tr>
                   <td align="left">账号占比</td>
                   <td colspan="3">
                       <input type="text" name="userRate" id="userRateId" value="${mvc.userRate}" class="easyui-validatebox" data-options="required:true" style="width:300px;">
                   </td>
               </tr>
               <tr>
		            <td><label for="apkUpload">包:</label></td>
		            <td colspan=3><input type="file" name="file" id="apk"></input></td>
	        	</tr>
		    </table>
		    <input type="hidden" name="id" id="id" value="${mvc.id}" style="width:300px;">
		    <div region="south" border="false" style="text-align: center; padding: 5px 5px 5px 0;">
	    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submit()">提交</a>
	    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="cancel()">取消</a>
	</div>
	</form>
	</div>
</div>
<script>
function submit() {
	$("#ff").form('submit', {
		url : '/miguVideoConfig/update',
		onSubmit : function() {
			var flag = $(this).form('validate');
			if (flag) {
				showProcess(true, market.content.title, market.content.submitting);
			}
			return flag;
		},
		success : function(data) {
			showProcess(false);
			var data = eval('(' + data + ')');
			if (data.return_code == '1') {
				top.showMsg(market.content.title, data.return_msg, alert);
				if (parent !== undefined) {
					if ($.isFunction(parent.reloadParent)) {
						parent.reloadParent.call();
						parent.closeMyWindow();
					} else {
						parent.$("#tt").datagrid('reload');
						parent.closeMyWindow();
					}
				}
			} else {
				$.messager.alert(market.content.title, data.return_msg);
			}
		},
		onLoadError : function() {
			showProcess(false);
			$.messager.alert(market.content.title, market.content.networkError);
		}
	});
}

function cancel() {
	parent.closeMyWindow();
}
</script>
</body>
</html>